#include "widget.h"
#include <QVariant>
#include <QColor>
#include <qDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    QVariant v(709);
    qDebug() << v.toInt();

    QVariant w("How are you");
    qDebug() << w.toString();

    QMap<QString, QVariant> map;
    map["int"] = 709;
    map["double"] = 709.709;
    map["string"] = "How are you";
    map["color"] = QColor(255, 0, 0);

    qDebug() << map["color"].value<QColor>();

    QStringList sl;
    sl << "A" << "B" << "C" << "D";
    QVariant slv(sl);

    {
        QStringList sl = slv.toStringList();
        for (int i = 0; i < sl.size(); ++i)
        {
            qDebug() << sl.at(i);
        }
    }
}

Widget::~Widget()
{

}
